package com.gopay.scheduler.job;

import com.gopay.common.constants.fund.FundFileSourceConstants;
import com.gopay.common.domain.fund.vo.FileBizParam;
import com.gopay.common.util.DateUtils;
import com.gopay.cps.service.FileHandlerService;
import com.gopay.scheduler.GopayBaseJob;
import org.apache.log4j.Logger;

import javax.annotation.Resource;
import java.util.Date;

/**
 * 基金支付：调拨文件生成之后1对账的差异文件处理，当天定时任务处理清算日期为当天的数据
 */

public class Fund1CheckDiffFileJob extends GopayBaseJob {
    private static final Logger logger = Logger.getLogger(Fund1CheckDiffFileJob.class);

    @Resource(name = "fileHandlerService")
    private FileHandlerService fileHandlerService;

    @Override
    public void doJobInternal() {
        try {
            logger.info("1对账差异文件处理定时任务开始！=============" + DateUtils.format(new Date()));
            FileBizParam fileBizParam = new FileBizParam(null, FundFileSourceConstants.CORN);
            String checkFile = fileHandlerService.checkAllocationFileDiff(fileBizParam);
            logger.info("1对账差异文件处理定时任务结果为 : " + checkFile + DateUtils.format(new Date()));
        } catch (Exception e) {
            logger.error("1对账差异文件处理定时任务异常", e);
        }

    }


}
